import { selfI18n } from '@/i18n/index';
export default function (LineXData, UtlizationLineData, OEELineData) {
    const $t = selfI18n;
    const title_map = {
        utilization_rate: $t('utilization_rate'),
        utilization_rate_and_OEE: $t('utilization_rate_and_OEE')
    };
    return {
        title: {
            text: title_map.utilization_rate_and_OEE + '（%）',
            top: '5%',
            textStyle: {
                fontSize: 14
            }
        },
        tooltip: {
            trigger: 'axis',
            formatter: (params) => {
                const percent = params[0].data !== '' ? '%' : '';
                return `${params[0].axisValue}
                <br>${params[0].marker}${title_map.utilization_rate}：${params[0].data}${percent}
                <br>${params[1].marker}OEE：${params[1].data}${percent}`;
            }
        },
        xAxis: {
            data: LineXData,
            axisLabel: {
                formatter: (params) => {
                    return params.slice(5);
                }
            },
            axisTick: {
                show: false
            }
        },
        grid: {
            left: '2%',
            right: '0',
            bottom: '10%',
            containLabel: true
        },
        yAxis: {
            axisLine: {
                show: false
            },
            axisTick: {
                show: false
            }
        },
        series: [
            {
                data: UtlizationLineData,
                type: 'line',
                itemStyle: {
                    normal: {
                        color: '#1b92ff'
                    }
                },
                lineStyle: {
                    color: '#1b92ff'
                }
            },
            {
                data: OEELineData,
                type: 'line',
                itemStyle: {
                    normal: {
                        color: '#4dca72'
                    }
                },
                lineStyle: {
                    color: '#4dca72'
                }
            }
        ]
    };
}
